package com.huangpeng.algorithm.species51;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @Author huangpeng
 * @Title 费式数列
 * @Package
 * @Date 2021/5/13 19:35
 * @Description
 * @Version 1.0
 */
public class FibonacciSequence {
    public static void hanoi(int n){
        List<Integer> list = new ArrayList<>();
        int sum = 0;
        if(n == 0){
            list.add(0,0);
        }
        if(n == 1){
            list.add(0,1);
        }else{
            sum = (n - 2) + (n - 1);
            list.add(sum);
        }
        list.forEach(System.out::println);
    }
    public static void main(String[] args) {
        System.out.println("请输入一个数n=");
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        FibonacciSequence.hanoi(n);
    }
}
